home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / rprint_1 / gridinpu.frm next >
Text File  |  1999-05-30  |  13KB  |  444 lines

  1. VERSION 5.00
  2. Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
  3. Begin VB.Form Formiga 
  4.    BackColor       =   &H00FFFFFF&
  5.    Caption         =   "Grid "
  6.    ClientHeight    =   8460
  7.    ClientLeft      =   -105
  8.    ClientTop       =   2355
  9.    ClientWidth     =   11205
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   8460
  13.    ScaleWidth      =   11205
  14.    WindowState     =   2  'Maximized
  15.    Begin VB.Frame Frame2 
  16.       BackColor       =   &H00FFFFFF&
  17.       BorderStyle     =   0  'None
  18.       Height          =   2295
  19.       Left            =   165
  20.       TabIndex        =   3
  21.       Top             =   -150
  22.       Width           =   9855
  23.       Begin VB.TextBox Invoice 
  24.          Appearance      =   0  'Flat
  25.          Height          =   285
  26.          Left            =   6090
  27.          TabIndex        =   11
  28.          Text            =   "Invoice"
  29.          Top             =   720
  30.          Width           =   1215
  31.       End
  32.       Begin VB.TextBox Country 
  33.          Appearance      =   0  'Flat
  34.          Height          =   375
  35.          Left            =   6120
  36.          TabIndex        =   9
  37.          Text            =   "Country"
  38.          Top             =   1680
  39.          Width           =   2775
  40.       End
  41.       Begin VB.TextBox CustAddress 
  42.          Appearance      =   0  'Flat
  43.          Height          =   375
  44.          Left            =   6090
  45.          TabIndex        =   8
  46.          Text            =   "CustAddress"
  47.          Top             =   1080
  48.          Width           =   2775
  49.       End
  50.       Begin VB.TextBox Date 
  51.          Appearance      =   0  'Flat
  52.          Height          =   375
  53.          Left            =   6090
  54.          TabIndex        =   7
  55.          Text            =   "Date"
  56.          Top             =   300
  57.          Width           =   1935
  58.       End
  59.       Begin VB.TextBox City 
  60.          Appearance      =   0  'Flat
  61.          Height          =   375
  62.          Left            =   3480
  63.          TabIndex        =   6
  64.          Text            =   "City"
  65.          Top             =   1680
  66.          Width           =   2580
  67.       End
  68.       Begin VB.TextBox CustomerName 
  69.          Appearance      =   0  'Flat
  70.          Height          =   405
  71.          Left            =   3480
  72.          TabIndex        =   4
  73.          Text            =   "CustomerName"
  74.          Top             =   1080
  75.          Width           =   2565
  76.       End
  77.       Begin VB.Label Label3 
  78.          Alignment       =   2  'Center
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "MsFlexGrid Cell Edit Example"
  81.          BeginProperty Font 
  82.             Name            =   "MS Sans Serif"
  83.             Size            =   9.75
  84.             Charset         =   177
  85.             Weight          =   700
  86.             Underline       =   0   'False
  87.             Italic          =   0   'False
  88.             Strikethrough   =   0   'False
  89.          EndProperty
  90.          ForeColor       =   &H00C00000&
  91.          Height          =   375
  92.          Left            =   15
  93.          TabIndex        =   12
  94.          Tag             =   "noprint"
  95.          Top             =   1800
  96.          Width           =   3375
  97.       End
  98.       Begin VB.Image Image1 
  99.          Height          =   1335
  100.          Left            =   -15
  101.          Picture         =   "GridInput.frx":0000
  102.          Stretch         =   -1  'True
  103.          Top             =   135
  104.          Width           =   3000
  105.       End
  106.       Begin VB.Label Label2 
  107.          BackStyle       =   0  'Transparent
  108.          Caption         =   "Order"
  109.          Height          =   255
  110.          Left            =   5340
  111.          TabIndex        =   10
  112.          Top             =   720
  113.          Width           =   615
  114.       End
  115.       Begin VB.Label Label1 
  116.          BackStyle       =   0  'Transparent
  117.          Caption         =   "Bill To"
  118.          Height          =   255
  119.          Left            =   3360
  120.          TabIndex        =   5
  121.          Top             =   720
  122.          Width           =   615
  123.       End
  124.    End
  125.    Begin VB.Frame Frame1 
  126.       BackColor       =   &H00FFFFFF&
  127.       BorderStyle     =   0  'None
  128.       Height          =   6255
  129.       Left            =   225
  130.       TabIndex        =   0
  131.       Top             =   2175
  132.       Width           =   9975
  133.       Begin VB.PictureBox inputpic 
  134.          Appearance      =   0  'Flat
  135.          BackColor       =   &H00FFFFFF&
  136.          ForeColor       =   &H80000008&
  137.          Height          =   300
  138.          Left            =   1080
  139.          ScaleHeight     =   270
  140.          ScaleWidth      =   795
  141.          TabIndex        =   1
  142.          Tag             =   "noprint"
  143.          Top             =   720
  144.          Visible         =   0   'False
  145.          Width           =   825
  146.          Begin VB.TextBox TMText 
  147.             Appearance      =   0  'Flat
  148.             BorderStyle     =   0  'None
  149.             BeginProperty Font 
  150.                Name            =   "MS Sans Serif"
  151.                Size            =   9.75
  152.                Charset         =   177
  153.                Weight          =   400
  154.                Underline       =   0   'False
  155.                Italic          =   0   'False
  156.                Strikethrough   =   0   'False
  157.             EndProperty
  158.             Height          =   390
  159.             Left            =   15
  160.             TabIndex        =   2
  161.             ToolTipText     =   "Enter data"
  162.             Top             =   0
  163.             Width           =   840
  164.          End
  165.       End
  166.       Begin MSFlexGridLib.MSFlexGrid gridinv 
  167.          Height          =   4965
  168.          Left            =   90
  169.          TabIndex        =   15
  170.          Top             =   180
  171.          Width           =   10530
  172.          _ExtentX        =   18574
  173.          _ExtentY        =   8758
  174.          _Version        =   393216
  175.          Rows            =   25
  176.          Cols            =   5
  177.          FixedCols       =   0
  178.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  179.             Name            =   "MS Sans Serif"
  180.             Size            =   9.75
  181.             Charset         =   177
  182.             Weight          =   400
  183.             Underline       =   0   'False
  184.             Italic          =   0   'False
  185.             Strikethrough   =   0   'False
  186.          EndProperty
  187.       End
  188.       Begin VB.Label Total 
  189.          Appearance      =   0  'Flat
  190.          BackColor       =   &H80000005&
  191.          BackStyle       =   0  'Transparent
  192.          BorderStyle     =   1  'Fixed Single
  193.          Caption         =   "Total"
  194.          ForeColor       =   &H80000008&
  195.          Height          =   255
  196.          Left            =   7290
  197.          TabIndex        =   14
  198.          Top             =   5490
  199.          Width           =   615
  200.       End
  201.       Begin VB.Label TotalInv 
  202.          Alignment       =   1  'Right Justify
  203.          BackStyle       =   0  'Transparent
  204.          Height          =   255
  205.          Left            =   8025
  206.          TabIndex        =   13
  207.          Top             =   5505
  208.          Width           =   1110
  209.       End
  210.    End
  211. End
  212. Attribute VB_Name = "Formiga"
  213. Attribute VB_GlobalNameSpace = False
  214. Attribute VB_Creatable = False
  215. Attribute VB_PredeclaredId = True
  216. Attribute VB_Exposed = False
  217. Dim LastLine As Integer
  218. Dim Edit As Boolean
  219. Dim OldCol As Integer
  220. Dim OldRow As Integer
  221.  
  222. Private Sub Form_Activate()
  223. gridinv.Col = 0
  224. TMText.SetFocus
  225. End Sub
  226.  
  227. Private Sub Form_Load()
  228. LastLine = 25
  229. Setgrid
  230. gridinv.Col = 1
  231. End Sub
  232.  
  233. Private Sub gridinv_EnterCell()
  234. Dim ResNo As Integer
  235. On Error Resume Next
  236. If Init Then Exit Sub
  237. ResNo = 116
  238. If gridinv.Col = 4 Then
  239. gridinv.Col = OldCol
  240. Exit Sub
  241. End If
  242. inputpic.Move gridinv.CellLeft - 20
  243. inputpic.Top = gridinv.CellTop + gridinv.Top - 20
  244. inputpic.Visible = True
  245.  
  246. inputpic.Width = gridinv.CellWidth + 10
  247. inputpic.Height = gridinv.CellHeight + 20
  248.  
  249. TMText.Width = inputpic.Width
  250.  
  251. OldCol = gridinv.Col
  252. OldRow = gridinv.Row
  253.  
  254. TMText.SetFocus
  255. TMText.Text = gridinv.Text
  256. TMText.SelStart = 0
  257. TMText.SelLength = 100
  258.  
  259.  
  260. OldCo